/* This file is part of MyRename
 * Copyright (C) 2005-2009 Kai-Chieh Ku (kjackie@gmail.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#pragma once

#include "Ini.h"
#include "filename.h"

#define SETRC(rc, l, t, r, b) {(rc).left = (l);(rc).top = (t);(rc).right = (r);(rc).bottom = (b);}
#define RCCOPY(a, b) {(a).left = (b).left;(a).top = (b).top;(a).right = (b).right;(a).bottom = (b).bottom;}
#define RCAREA(rc) (((rc).bottom - (rc).top) * ((rc).right - (rc).left))

class CPreferences : public CIni
{
public:
	CPreferences(LPCTSTR lpPathName = NULL);
	virtual ~CPreferences();

///////////////////////////////////////////////

	void LoadSettings();
	void SaveSettings();
	static INT_PTR UIntArrayToStringArray(CStringArray &sArray, const CUIntArray &uArray);
	static INT_PTR StringArrayToUIntArray(CUIntArray &uArray, const CStringArray &sArray);

	bool all_ready;
	CFileName fnMask;
	CString sAppDir;
	CString sAppPath;

///////////////////////////////////////////////

//[MyRename]
	UINT uVersion;
	CRect rcMainWindow;
	BOOL bMaximize;
	BOOL bConfirmRn;
	BOOL bConfirmUd;
	BOOL bAutoDelThumbs;
	UINT uLanguage;

//[FileWnd]
	//dir tree --->
	CString sLastPath;
	//dir tree <---

	BOOL bSmartSort;

	UINT uLSpiltterPos;
	UINT uRSpiltterPos;

	//existing filename list --->
	CUIntArray uaExtColWidth;
	CUIntArray uaExtColOrder;
	UINT uExtSortCol;
	BOOL bExtSortAsc;
	BOOL bExtAutoScroll;
	//existing filename list <---

	//preview filename list --->
	CUIntArray uaPreColWidth;
	CUIntArray uaPreColOrder;
	//preview filename list <---

//[ControlPanel]
	int iFnMode;
	CString sFnInput;

	int iExtMode;
	CString sExtInput;

	int iCaseMode;

	BOOL bNumEnable;
	int iNumStart;
	int iNumDiff;
	int iNumWidth;

	BOOL bRpEnable;
	BOOL bRxEnable;
	BOOL bRpMatchCase;
	CString sRpFind;
	CString sRpReplace;

	BOOL bBig5Fix;
	BOOL bFullToHalf;
//[Filter]
	BOOL bFtFolder;
	BOOL bFtHidden;
	BOOL bFtReadOnly;
	BOOL bFtSystem;
	CString sFtMask;
};

extern CPreferences thePrefs;
